// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIDomainPolicy.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// When a domain policy is instantiated by invoking activateDomainPolicy() on
    /// nsIScriptSecurityManager, these domain sets are consulted when each new
    /// global is created (they have no effect on already-created globals).
    /// If javascript is globally enabled with |javascript.enabled|, the blacklists
    /// are consulted. If globally disabled, the whitelists are consulted. Lookups
    /// on blacklist and whitelist happen with contains(), and lookups on
    /// superBlacklist and superWhitelist happen with containsSuperDomain().
    ///
    /// When deactivate() is invoked, the domain sets are emptied, and the
    /// nsIDomainPolicy ceases to have any effect on the system.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("82b24a20-6701-4d40-a0f9-f5dc7321b555")]
	public interface nsIDomainPolicy
	{
		
		/// <summary>
        /// When a domain policy is instantiated by invoking activateDomainPolicy() on
        /// nsIScriptSecurityManager, these domain sets are consulted when each new
        /// global is created (they have no effect on already-created globals).
        /// If javascript is globally enabled with |javascript.enabled|, the blacklists
        /// are consulted. If globally disabled, the whitelists are consulted. Lookups
        /// on blacklist and whitelist happen with contains(), and lookups on
        /// superBlacklist and superWhitelist happen with containsSuperDomain().
        ///
        /// When deactivate() is invoked, the domain sets are emptied, and the
        /// nsIDomainPolicy ceases to have any effect on the system.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDomainSet GetBlacklistAttribute();
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDomainSet GetSuperBlacklistAttribute();
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDomainSet GetWhitelistAttribute();
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDomainSet GetSuperWhitelistAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Deactivate();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void CloneDomainPolicy(System.IntPtr aClone);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ApplyClone(System.IntPtr aClone);
	}
	
	/// <summary>nsIDomainSet </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("665c981b-0a0f-4229-ac06-a826e02d4f69")]
	public interface nsIDomainSet
	{
		
		/// <summary>
        /// The type of the set. See: DomainSetType
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		uint GetTypeAttribute();
		
		/// <summary>
        /// Add a domain to the set. No-op if it already exists.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Add([MarshalAs(UnmanagedType.Interface)] nsIURI aDomain);
		
		/// <summary>
        /// Remove a domain from the set. No-op if it doesn't exist.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Remove([MarshalAs(UnmanagedType.Interface)] nsIURI aDomain);
		
		/// <summary>
        /// Remove all entries from the set.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Clear();
		
		/// <summary>
        /// Returns true if a given domain is in the set.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool Contains([MarshalAs(UnmanagedType.Interface)] nsIURI aDomain);
		
		/// <summary>
        /// Returns true if a given domain is a subdomain of one of the entries in
        /// the set.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool ContainsSuperDomain([MarshalAs(UnmanagedType.Interface)] nsIURI aDomain);
	}
}
